Compilation errors

Now, we'll edit the file so as to induce a compilation error. After attempting to compile, the error will be reported in the Shell tool. From the error message, you can go straight to the point in the source code where the error was found.

In the Source Editor's Symbol List (on the right), click on

main (me) -- the (me) stands for 'method'.
The editor positions to main .

- To comment out the line with the
main method, click into it and choose Edit > Comment.
Note that you can comment out any number of lines by highlighting them and choosing this menu item.
For the changes to take effect, choose File > Save.
To compile the file, choose Target > Make File BackOfficeApplication.class.
A Shell Tool appears and SNiFF+ tries to compile the modified file.
The error is reported in the Shell Tool in the form file:line: error , followed by the actual line.

In the Shell tool

- To see the error, click on the reported error (highlighted in the illustration) and choose
Edit > Show Error.

The Source Editor positions to detected error, and the affected line is highlighted.

In the Source Editor
To uncomment the line that induced the error:

Click into the line you commented out earlier and choose Edit > Uncomment.
For the changes to take effect, choose File > Save.
Choose Target > Make File BackOfficeApplication.class again to re-compile.

- Close the Source Editor and the Shell tool to avoid screen cluttering.

Review
In this chapter you

- checked out a file to get a writable version
- edited a file
- compiled the file
- found and fixed a compilation error